home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / misc / emu / amiSPIMsrc.lha / Documentation / SPIM_and_Amiga < prev    next >
Text File  |  1994-02-09  |  8KB  |  324 lines

  1. Here's a sample of the changes necessary to make SPIM (and XSPIM) compile
  2. on the Amiga. You will need gcc 2.3.3 (maybe other versions will work),
  3. a lex derivative and libnet.a to link with. Thus you need ixemul v39.47 too.
  4.  
  5. To run SPIM you need to assign SPIM: to some spot where SPIM can find the
  6. trap.handler (usually spim:lib/trap.handler). This can be specified in the
  7. makefile (which is supplied at the bottom of this text)
  8.  
  9. - Kjetil Jacobsen (kjetilja@stud.cs.uit.no)
  10.  
  11.  
  12. diff -c spim.amiga//cl-except.h spim.orig//cl-except.h
  13. *** spim.amiga//cl-except.h    Mon Feb  7 00:34:34 1994
  14. --- spim.orig//cl-except.h    Mon May 17 22:36:02 1993
  15. ***************
  16. *** 20,30 ****
  17.      PURPOSE.
  18.   */
  19.   
  20. - #ifndef amiga
  21.   #include <syscall.h>
  22. - #else
  23. - #include <sys/syscall.h>
  24. - #endif
  25.   #include <signal.h>
  26.   
  27.   /* gdb-style for tracking each signal */
  28. --- 20,26 ----
  29. diff -c spim.amiga//cl-except.h spim.orig//cl-except.hspim.amiga//mips-syscall.c spim.orig//mips-syscall.c
  30. *** spim.amiga//mips-syscall.c    Tue Feb  8 23:32:08 1994
  31. --- spim.orig//mips-syscall.c    Tue Jan 18 04:22:28 1994
  32. ***************
  33. *** 36,41 ****
  34. --- 36,42 ----
  35.   #include <limits.h>
  36.   #endif
  37.   
  38.   #include "spim.h"
  39.   #include "inst.h"
  40.   #include "mem.h"
  41. ***************
  42. *** 848,860 ****
  43.     arg1 = SYSCALL_ARG (REG_V0,arg1, REG_A1);
  44.     arg2 = SYSCALL_ARG (REG_V0,arg2, REG_A2);
  45.     arg3 = SYSCALL_ARG (REG_V0,arg3, REG_A3);
  46. - #ifdef amiga /* There's no reason for us to get here, just over-anxious :) */ 
  47. -   printf("Amiga warning: Unsupported syscall\n");
  48. -   return -1;
  49. - #else
  50.     R[REG_RES] = syscall (R[REG_V0], arg0, arg1, arg2, arg3);
  51. ! #endif
  52.     /* See if an error has occurred during the system call. If so, the
  53.        libc wrapper must be notifified by setting register 7 to be less than
  54.        zero and the return value should be errno. If not, register 7 should
  55. --- 849,856 ----
  56.     arg1 = SYSCALL_ARG (REG_V0,arg1, REG_A1);
  57.     arg2 = SYSCALL_ARG (REG_V0,arg2, REG_A2);
  58.     arg3 = SYSCALL_ARG (REG_V0,arg3, REG_A3);
  59.     R[REG_RES] = syscall (R[REG_V0], arg0, arg1, arg2, arg3);
  60.     /* See if an error has occurred during the system call. If so, the
  61.        libc wrapper must be notifified by setting register 7 to be less than
  62.        zero and the return value should be errno. If not, register 7 should
  63. diff -c spim.amiga//mips-syscall.c spim.orig//mips-syscall.cspim.amiga//spim-utils.c spim.orig//spim-utils.c
  64. *** spim.amiga//spim-utils.c    Thu Feb  3 22:40:12 1994
  65. --- spim.orig//spim-utils.c    Tue Jan 18 04:22:50 1994
  66. ***************
  67. *** 524,530 ****
  68.   #endif
  69.     fmt = va_arg (args, char *);
  70.   
  71. ! #if defined(mips) || defined(amiga)
  72.     vfprintf (stderr, fmt, args);
  73.   #else
  74.     _doprnt (fmt, args, stderr);
  75. --- 524,530 ----
  76.   #endif
  77.     fmt = va_arg (args, char *);
  78.   
  79. ! #ifdef mips
  80.     vfprintf (stderr, fmt, args);
  81.   #else
  82.     _doprnt (fmt, args, stderr);
  83. diff -c spim.amiga//spim-utils.c spim.orig//spim-utils.cspim.amiga//spim.c spim.orig//spim.c
  84. *** spim.amiga//spim.c    Wed Feb  9 15:39:05 1994
  85. --- spim.orig//spim.c    Tue Jan 18 15:47:20 1994
  86. ***************
  87. *** 1183,1189 ****
  88.     fmt = va_arg (args, char *);
  89.   #endif
  90.   
  91. ! #if defined(mips) || defined(amiga)
  92.     vfprintf (stderr, fmt, args);
  93.   #else
  94.     _doprnt (fmt, args, stderr);
  95. --- 1183,1189 ----
  96.     fmt = va_arg (args, char *);
  97.   #endif
  98.   
  99. ! #ifdef mips
  100.     vfprintf (stderr, fmt, args);
  101.   #else
  102.     _doprnt (fmt, args, stderr);
  103. ***************
  104. *** 1218,1224 ****
  105.   
  106.     console_to_spim ();
  107.   
  108. ! #if defined(mips) || defined(amiga)
  109.     vfprintf (stderr, fmt, args);
  110.   #else
  111.     _doprnt (fmt, args, stderr);
  112. --- 1218,1224 ----
  113.   
  114.     console_to_spim ();
  115.   
  116. ! #ifdef mips
  117.     vfprintf (stderr, fmt, args);
  118.   #else
  119.     _doprnt (fmt, args, stderr);
  120. ***************
  121. *** 1266,1272 ****
  122.         console_to_spim ();
  123.       }
  124.   
  125. ! #if defined(mips) || defined(amiga)
  126.     if (f != 0)
  127.       vfprintf (f, fmt, args);
  128.     else
  129. --- 1266,1272 ----
  130.         console_to_spim ();
  131.       }
  132.   
  133. ! #ifdef mips
  134.     if (f != 0)
  135.       vfprintf (f, fmt, args);
  136.     else
  137.  
  138. -------------------------Makefile.amiga (gcc)-------------------------
  139. #
  140. # SPIM S20 MIPS Simulator.
  141. # Makefile for SPIM.
  142. # Copyright (C) 1990-1992 by James Larus (larus@cs.wisc.edu).
  143. # ALL RIGHTS RESERVED.
  144. #
  145. # SPIM is distributed under the following conditions:
  146. #
  147. #   You may make copies of SPIM for your own use and modify those copies.
  148. #
  149. #   All copies of SPIM must retain my name and copyright notice.
  150. #
  151. #   You may not sell SPIM or distributed SPIM in conjunction with a commerical
  152. #   product or service without the expressed written consent of James Larus.
  153. #
  154. # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  155. # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  156. # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  157. # PURPOSE.
  158. #
  159. # NOTES ON AMIGA VERSION:
  160. #   Amiga modifications by Kjetil Jacobsen / Ymir's Thoughts
  161. #   The distributed binaries were compiled with gcc2.3.3, using gmake and flex.
  162. #   You need ixemul v39.47 (or later) to run SPIM.
  163. #   This Amiga version is based on spim/xspim version 5.4
  164. #
  165. # To make spim, type:
  166. #
  167. #   make spim
  168. #
  169. # To make xpsim, type:
  170. #
  171. #   make xspim
  172. #
  173.  
  174. #
  175. # To make cl-spim (cycle level SPIM simulator), type:
  176. #
  177. #   make cl-spim
  178. #
  179. # To make cl-xpsim, type:
  180. #
  181. #   make cl-xspim
  182. #
  183.  
  184. # This is amiga specific, so it's got an unique vesion number.
  185. ENDIAN = BIGENDIAN
  186. AMIGAVER = 1
  187.  
  188. # Full path for directory containing X11 include files:
  189. X_INCLUDE_DIR = gcc:include/x11r5
  190.  
  191. # Location of X11 root directory.
  192. TOPDIR = gcc:
  193.  
  194.  
  195. # Full path for directory that will hold the trap handler file:
  196. TRAP_DIR = spim:lib
  197.  
  198. # Full path for the directory that will hold the executable files:
  199. BIN_DIR = bin:
  200.  
  201. # Full path for the directory that will hold the man files:
  202. MAN_DIR = doc:
  203.  
  204. # Full path for the trap handler file:
  205. TRAP_PATH = \"$(TRAP_DIR)/trap.handler\"
  206.  
  207. # If you have flex, use it instead of lex.  If you use flex, define this
  208. # variable and set LEXFLAGS.
  209. MYLEX = flex
  210.  
  211. # SPIM needs flex's -I flag since the scanner is used interactively.
  212. # You can set the -8 flag so that funny characters do not hang the scanner.
  213. LEXFLAGS = -I -8
  214.  
  215.  
  216. # If you use lex, set the variables this way:
  217. #MYLEX = lex
  218. #LEXFLAGS =
  219.  
  220.  
  221. # Size of the segments when spim starts up (data segment must be >= 64K).
  222. # (These sizes are fine for most users since SPIM dynamically expands
  223. # the memory as necessary.)
  224. MEM_SIZES = -DTEXT_SIZE=65536 -DDATA_SIZE=131072 -DK_TEXT_SIZE=65536
  225.  
  226.  
  227. #
  228. # End of parameters
  229. #
  230.  
  231.  
  232. CC = gcc
  233. OPTFLAGS = 
  234. AMIFLAGS = -Damiga -D_ANSI_SOURCE
  235. IFLAGS = -Igcc:include
  236. CL_FLAG =
  237. CFLAGS = -c $(OPTFLAGS) $(IFLAGS) -D$(ENDIAN) $(AMIFLAGS) $(MEM_SIZES) -I$(X_INCLUDE_DIR) $(EXTRA_C_FLAGS) $(CL_FLAG)
  238. YFLAGS = -d
  239. YCFLAGS =
  240. LDFLAGS = -lnet -lamy -lm
  241. XLDFLAGS = -L$(TOPDIR)/lib -lXaw -lXmu -lXt -lXext -lX11
  242.  
  243.  
  244. # lex.yy.c is usually compiled with -O to speed it up.
  245.  
  246. LEXCFLAGS = -O
  247.  
  248. OBJS = spim-utils.o run.o mem.o inst.o data.o sym-tbl.o y.tab.o lex.yy.o \
  249.        read-aout.o mips-syscall.o
  250.  
  251.  
  252. XOBJS = windows.o buttons.o
  253.  
  254.  
  255. CLOBJS = cl-cache.o cl-except.o cl-tlb.o cl-cycle.o
  256.  
  257.  
  258. spim:    $(OBJS) spim.o
  259.     $(CC) -o spim $(OBJS) spim.o $(LDFLAGS)
  260.  
  261. xspim:    $(OBJS) $(XOBJS) xspim.o
  262.     $(CC) -o xspim $(OBJS) $(XOBJS) xspim.o $(XLDFLAGS) $(LDFLAGS) 
  263.  
  264.  
  265. cl-spim: $(OBJS) $(CLOBJS) spim.o
  266.     $(CC) -o cl-spim $(OBJS) $(CLOBJS) spim.o $(LDFLAGS)
  267.  
  268. cl-xspim: $(OBJS) $(CLOBJS) $(XOBJS) xspim.o
  269.     $(CC) -o cl-xspim $(OBJS) $(CLOBJS) $(XOBJS) xspim.o $(XLDFLAGS) $(LDFLAGS) 
  270.  
  271.  
  272. TAGS:    *.c *.h *.l *.y
  273.     etags *.l *.y *.c *.h
  274.  
  275.  
  276. clean:
  277.     delete spim xspim cl-spim cl-xspim *.o y.output *.bak core a.out \
  278.       .spim-made .cl-spim-made \
  279.       spim.tar.* spim.aux spim.log spim.dvi spim.shar*
  280.  
  281. install: spim xspim
  282.     install -c -s  spim $(BIN_DIR)
  283.     install -c -s  xspim $(BIN_DIR)
  284.     install -c -m 0444 trap.handler $(TRAP_DIR)
  285.     install -c -m 0444 spim.man $(MAN_DIR)
  286.     install -c -m 0444 xspim.man $(MAN_DIR)
  287.  
  288. very-clean: clean
  289.     delete y.tab.h y.tab.c lex.yy.c spim.tar* Documentation/spim.ps
  290.  
  291.  
  292. SRC = spim-utils.c run.c mem.c inst.c data.c sym-tbl.c y.tab.o lex.yy.o \
  293.        read-aout.c mips-syscall.c
  294.  
  295. XSRC = windows.c buttons.c
  296.  
  297.  
  298. #
  299. # Dependences not handled well by makedepend:
  300. #
  301.  
  302. spim-utils.o: spim-utils.c spim.h inst.h mem.h reg.h y.tab.h 
  303.     $(CC) $(CFLAGS) -DDEFAULT_TRAP_HANDLER=$(TRAP_PATH) -DSPIM_VERSION=$(AMIGAVER) -c spim-utils.c
  304.  
  305.  
  306. y.tab.h: y.tab.c
  307.  
  308. y.tab.c: parser.y
  309.     yacc $(YFLAGS) parser.y
  310.  
  311. y.tab.o: y.tab.c
  312.     $(CC) $(CFLAGS) $(YCFLAGS) -c y.tab.c
  313.  
  314.  
  315. lex.yy.c: scanner.l
  316.     $(MYLEX) $(LEXFLAGS) scanner.l
  317.  
  318. lex.yy.o: lex.yy.c
  319.     $(CC) $(LEXCFLAGS) -c lex.yy.c
  320.  
  321.